import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterLink, RouterOutlet } from '@angular/router';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzLayoutModule } from 'ng-zorro-antd/layout';
import { NzMenuModule } from 'ng-zorro-antd/menu';
import { AppServerService } from './server/app-server.service';
import {AppPermisionServerService} from "./server/app-permision-server.service";


@Component({
  selector: 'app-root',
  standalone: true,
  //页面要用的 组件
  imports: [CommonModule, RouterLink, RouterOutlet, NzIconModule, NzLayoutModule, NzMenuModule],
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {

  constructor(private appServer: AppServerService ,
              private appPermisionSService: AppPermisionServerService){

  }

  ngOnInit() {
    this.appServer.loginStatusDetectionTask();
    this.appServer.ScheduledLoginStatusDetectionTask();
    //return
  }

  ngOnDestroy(){
    console.log('AppComponent ngOnDestroy ');
    this.appServer.StopScheduledLoginStatusDetectionTask();

  }



}
